package com.multi.thread.chapter02.demo12;

import java.util.concurrent.atomic.AtomicInteger;

public class AddCountThread extends Thread {
	
	private AtomicInteger count = new AtomicInteger(0);
	
	@Override
	public void run() {
		for (int i = 0; i < 100; i++) {
			System.out.println(count.incrementAndGet());
		}
	}
	
	public static void main(String[] args) {
		AddCountThread thread = new AddCountThread();
		
		Thread t1 = new Thread(thread);
		t1.start();
		
		Thread t2 = new Thread(thread);
		t2.start();
	}

}
